/*
 *  Copyright 2015-2016, RenGu Technology (BeiJing) Co., Ltd.
 *  All right reserved.
 *
 *  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF RENGU TECHNOLOGY (BeiJing) CO., LTD.
 *
 *  THE CONTENTS OF THIS FILE MAY NOT BE DISCLOSED TO THIR PARTIES,
 *  COPIED OR DUPLICATED IN ANY FORM, IN WHOLE OR IN PART,
 *  WITHOUT THE PRIOR WRITTEN PERMISSION OF RENGU TECHNOLOGY (BeiJing) CO., LTD.
 *
 *  AcctTransStatusEnum
 *
 *  Edit History:
 *      lizhangtao Created on 2020年04月13日
 *
 */
package cc.rengu.igas.acct.common.enums;

/**
 * 账户交易状态枚举
 *
 * @author lizhangtao
 */
public enum AcctTransStatusEnum {
    //记账成功
    SUCC("00", "记账成功"),
    //记账失败
    FAIL("01", "记账失败"),
    //预授权已经被撤销
    CANCELED("02", "预授权已经被撤销"),
    //预授权已经被完成
    COMPLETED("03", "预授权已经被完成"),
    ;
    private String status;
    private String desc;

    AcctTransStatusEnum(String status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public String getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }


    public static AcctTransStatusEnum getInstance(String status) {
        switch (status) {
            case "00":
                return SUCC;
            case "01":
                return FAIL;
            case "02":
                return CANCELED;
            case "03":
                return COMPLETED;
            default:
                return null;
        }
    }
}
